#include<bits/stdc++.h>
using namespace std;

int a[111], b[111], c[111];
int f[2][111];

int main()
{
	int n;
	cin>>n;
	for(int i = 1;i <= n;i++)
		cin>>a[i]>>b[i]>>c[i];
	
	f[0][1] = a[1]+c[1];
	f[1][1] = b[1];
	for(int i = 2;i <= n;i++)
	{
		f[0][i] = min(f[0][i-1]+a[i], f[1][i-1]+a[i]+c[i]);
		f[1][i] = min(f[1][i-1]+b[i], f[0][i-1]+b[i]+c[i]);
	}
	cout<<min(f[0][n], f[1][n]);
	return 0;
}

